const news = require('./news.json');

let result = news.map(item => {
  return {
    abstract: item.Abstract,
    url: item.article_url,
    comment_count: item.comment_count,
    date: item.cursor,
    images: item.image_list ? item.image_list.map(item => item.url) : [],
    title: item.title,
    author: item.media_name
  }
});

//将数据转为 JSON 存入到文件中
require('fs').writeFileSync('./data.json', JSON.stringify(result, null, 2))
